package com.wnxy.sddfp.common.util;

import com.wnxy.sddfp.common.constant.UserConstant;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class TokenUtils {
    public static Long getTokenUserId() {
        HttpServletRequest request= ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        String userId = request.getHeader(UserConstant.USERID);
        return Long.parseLong(userId);
    }
}
